
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import { $http } from '@escook/request-miniprogram'
import store from './store/store.js'


Vue.config.productionTip = false

App.mpType = 'app'

uni.showMsg = function(msg, time=1500) {
	uni.showToast({
		title: msg,
		duration: time,
		icon: 'none'
	})
}
uni.$http = $http
$http.baseUrl = 'https://www.uinav.com'
$http.beforeRequest = function(options) {
	uni.showLoading({
		title: '加载中'
	})
	if (options.url.indexOf('/my/') !== -1) {
		options.header = {
			Authorization: "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjEyLCJpYXQiOjE1MjU0MDIyMjMsImV4cCI6MTUyNTQ4ODYyM30.g-4GtEQNPwT_Xs0Pq7Lrco_9DfHQQsBiOKZerkO-O-o"
		}
	}
	console.log(options)
}
$http.afterRequest = function() {
		uni.hideLoading()
	}
const app = new Vue({
    ...App,
	store
})
app.$mount()
// #endif

Vue.filter('tofixed', function (value) {
  return Number(value).toFixed(2);
})
// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif